const local = {
  GetItem: function (key) {
    return localStorage.getItem(key);
  },
  /**
   *
   * @param {默认键值对} key
   * @param {值} value
   * @param {vuex} Vuex
   * @param {软件信息} softInfo
   */
  SetItem: function (key, value, Vuex, softInfo) {
    Vuex.commit("SETOPENSOFTS", softInfo);
    localStorage.setItem(key, value);
  },
  removeItem: function () {
    localStorage.removeItem(key);
  },
  ClearItem: function () {
    localStorage.clear();
  },
  GetOpenedSoft() {
    if (local.GetItem("OpenInfo")) {
      const res = JSON.parse(local.GetItem("OpenInfo"));
      return res;
    }
    return [];
  },
};
module.exports = local;
